package com.homeparking.manage.service.impl;

import java.util.List;
import com.homeparking.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.homeparking.manage.mapper.ManageAreaMapper;
import com.homeparking.manage.domain.ManageArea;
import com.homeparking.manage.service.IManageAreaService;

/**
 * 省市县Service业务层处理
 * 
 * @author liuyangyang
 * @date 2025-10-24
 */
@Service
public class ManageAreaServiceImpl implements IManageAreaService 
{
    @Autowired
    private ManageAreaMapper manageAreaMapper;

    /**
     * 查询省市县
     * 
     * @param areaId 省市县主键
     * @return 省市县
     */
    @Override
    public ManageArea selectManageAreaByAreaId(Long areaId)
    {
        return manageAreaMapper.selectManageAreaByAreaId(areaId);
    }

    /**
     * 查询省市县列表
     * 
     * @param manageArea 省市县
     * @return 省市县
     */
    @Override
    public List<ManageArea> selectManageAreaList(ManageArea manageArea)
    {
        return manageAreaMapper.selectManageAreaList(manageArea);
    }

    /**
     * 新增省市县
     * 
     * @param manageArea 省市县
     * @return 结果
     */
    @Override
    public int insertManageArea(ManageArea manageArea)
    {
        manageArea.setCreateTime(DateUtils.getNowDate());
        return manageAreaMapper.insertManageArea(manageArea);
    }

    /**
     * 修改省市县
     * 
     * @param manageArea 省市县
     * @return 结果
     */
    @Override
    public int updateManageArea(ManageArea manageArea)
    {
        manageArea.setUpdateTime(DateUtils.getNowDate());
        return manageAreaMapper.updateManageArea(manageArea);
    }

    /**
     * 批量删除省市县
     * 
     * @param areaIds 需要删除的省市县主键
     * @return 结果
     */
    @Override
    public int deleteManageAreaByAreaIds(Long[] areaIds)
    {
        return manageAreaMapper.deleteManageAreaByAreaIds(areaIds);
    }

    /**
     * 删除省市县信息
     * 
     * @param areaId 省市县主键
     * @return 结果
     */
    @Override
    public int deleteManageAreaByAreaId(Long areaId)
    {
        return manageAreaMapper.deleteManageAreaByAreaId(areaId);
    }
}
